how to find character count in java